package view.macrogui
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	/**
	 */
	public class Panel extends Sprite
	{
		private var closeButton:Sprite;
		
		public function Panel(x:int, y:int, width:int = 200, height:int = 200)
		{
			this.x = x;
			this.y = y;
			
			graphics.beginFill(0x777777, 0.7);
			graphics.lineStyle(1.0, 0x111111);
			graphics.drawRect(0, 0, width, height);
			graphics.endFill();
			
			closeButton = new Sprite();
			closeButton.graphics.beginFill(0xDDDDDD);
			closeButton.graphics.drawCircle(0, 0, 7);
			closeButton.graphics.endFill();
			closeButton.x = width;
			closeButton.y = 0;
			addChild(closeButton);
			closeButton.addEventListener(MouseEvent.CLICK, close);
		}
		
		public function close(e:Event = null):void
		{
			parent.removeChild(this);
		}
	
	}

}